package com.xujf.sym.newsChannel;

import com.xujf.sym.App;
import com.xujf.sym.R;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by xujf on 2018/4/11.
 */

public class ItemsDao {

    public List<NewsChannelBean> getEnableData() {
        List<NewsChannelBean> list = new ArrayList<>();
        String categoryId[] = App.Companion.getApplication().getResources().getStringArray(R.array.mobile_news_id);
        String categoryName[] = App.Companion.getApplication().getResources().getStringArray(R.array.mobile_news_name);
        for (int i = 0; i < 8; i++) {
//            add(categoryId[i], categoryName[i], Constant.NEWS_CHANNEL_ENABLE, i);
            NewsChannelBean bean = new NewsChannelBean();
            bean.setChannelId(categoryId[i]);
            bean.setChannelName(categoryName[i]);
            bean.setIsEnable(Constant.NEWS_CHANNEL_ENABLE);
            bean.setPosition(i);
            list.add(bean);
        }
        return list;
    }

    public List<NewsChannelBean> getDisableData() {
        List<NewsChannelBean> list = new ArrayList<>();
        String categoryId[] = App.Companion.getApplication().getResources().getStringArray(R.array.mobile_news_id);
        String categoryName[] = App.Companion.getApplication().getResources().getStringArray(R.array.mobile_news_name);
        for (int i = 8; i < categoryId.length; i++) {
//            add(categoryId[i], categoryName[i], Constant.NEWS_CHANNEL_ENABLE, i);
            NewsChannelBean bean = new NewsChannelBean();
            bean.setChannelId(categoryId[i]);
            bean.setChannelName(categoryName[i]);
            bean.setIsEnable(Constant.NEWS_CHANNEL_DISABLE);
            bean.setPosition(i);
            list.add(bean);
        }
        return list;
    }
}
